//
//  RootViewController.h
//  FuelLog
//
//  Created by Olaf on 13.06.10.
//  Copyright __MyCompanyName__ 2010. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <CoreData/CoreData.h>

#import "AddCarViewController.h"
#import "CarsViewController.h"
#import "GasViewController.h"
#import "StatsV2ViewController.h"
#import "DateViewController.h"
#import "PrefsV2ViewController.h"
#import "LoginViewController.h"
#import "FilesViewController.h"


@interface RootViewController : UITableViewController <NSFetchedResultsControllerDelegate> { 
    NSFetchedResultsController *fetchedResultsController;
    NSManagedObjectContext *managedObjectContext;
	CarsViewController *carsController;
	GasViewController *gasController;
	StatsViewController *statsController;
	PrefsViewController *prefsController;
	
	NSManagedObject * currentCar;
	UIBarButtonItem *carsButton;
	UIBarButtonItem *prefsButton;
	UIBarButtonItem *statsButton;
	UIBarButtonItem *addButton;
	UIBarButtonItem *toolBarSpacer; 
	
} 
@property(nonatomic, retain)	NSManagedObject * currentCar;
@property(nonatomic, retain) UIBarButtonItem *carsButton;
@property(nonatomic, retain) UIBarButtonItem *prefsButton;
@property(nonatomic, retain) UIBarButtonItem *statsButton;
@property(nonatomic, retain) UIBarButtonItem *addButton;
@property(nonatomic, retain) UIBarButtonItem *toolBarSpacer;

@property (nonatomic, retain) NSFetchedResultsController *fetchedResultsController;
@property (nonatomic, retain) NSManagedObjectContext *managedObjectContext;

-(void) populateEmptyPersistanceStore ;
-(IBAction)addCar:(id)sender;
- (IBAction)addGas:(id)sender;
- (IBAction)viewStats:(id)sender;
- (IBAction)setPrefs:(id)sender;
-(NSString *)getTitleString;

@end
